<?php include THEMES_PATH.'public/before_body2.phtml';?>
<link href="/statics/front/css/product.css" rel="stylesheet">
<style>
.email-popup{padding:2em;}
.email-popup>.line{display:block;margin-bottom:1em;height:1px;background:-webkit-linear-gradient(left,#fff,#e7e7e7,#fff);background:-moz-linear-gradient(left,#fff,#e7e7e7,#fff);background:-o-linear-gradient(left,#fff,#e7e7e7,#fff);background-color:#e7e7e7;background-image:-ms-linear-gradient(left,#fff,#e7e7e7,#fff);background-image:linear-gradient(left,#fff,#e7e7e7,#fff);}
.email-popup>strong{display:block;font-size:2em;color:#fe750d;}
.email-popup input[type=text]{margin-right:.5em;padding:0 .5em;width:60%;height:32px;border:1px solid #ccc;border-radius:3px;vertical-align:middle;font-size:.9em;}
input.error {background-color:#fff;}
.email-popup button{padding:0 1em;height:40px;border-radius:3px;background-color:#369;vertical-align:middle;}
p.error {color:#db5f12;}
.email-popup>a{color:#336598;text-decoration:underline;}
@media screen and (max-width:568px){
.email-popup{width:60%;}
.email-popup input[type=text]{width:45%;}
}
@media screen and (max-width:320px){
.email-popup input[type=text]{margin-right:0;margin-bottom:1em;width:100%;}
.email-popup{width:70%;}
}
</style>
</head>
<body>
<?php include THEMES_PATH.'public/header2.phtml';?>
<p class="align-center collection-title"><?php echo $info['collection_title'];?></p>
<?php foreach($collection_info as $k=>$v):?>
<?php if(isset($v['img_path'])&&!empty($v['img_path'])):?>
<img src="<?php echo $v['img_path']?>" alt="collection banner" class="center-block collection-banner" />
<?php endif;?>
<ul class="product-list product-collection js-product-list">
<?php 
  foreach($product_list[$k] as $key => $product){
?>
<li>
  <a href="<?php echo $product['url'];?>"<?php if($target_blank):?> target="_blank"<?php endif;?>>
    <?php
      $advanced_price = $product['advanced_price'];
      $original_price = $product['original_price'];
      $discounts = round((($original_price - $advanced_price)/$original_price) *100);
    ?>
    <?php
    if($product['original_price']!=0){
          $discountimg=$product['goods_img'] ? $product['goods_img'] : $product['list_img'];
          $discount="<img data-original='".$discountimg."' alt='".$product['name']."' />";
    if(!empty($product['ml_img'])) $discount.="<img data-original='".$product['ml_img']."' class='hide' />";
    $discount.="<span class='mark mark-off js-mark'><em>-$discounts%</em></span>";
          echo $discount;
    }elseif($product['hot'] == 1){
          $img=$product['goods_img'] ? $product['goods_img'] : $product['list_img'];
          $hot="<img data-original='".$img."' alt='".$product['name']."' />";
    if(!empty($product['ml_img'])) $hot.="<img data-original='".$product['ml_img']."' class='hide' />";
    $hot.="<span class='mark mark-hot js-mark'><em>".L('_hot_')."</em></span>";
          echo $hot;
    }elseif($product['new_product'] == 1){
          $newimg=$product['goods_img'] ? $product['goods_img'] : $product['list_img'];
          $new="<img data-original='".$newimg."' alt='".$product['name']."' />";
    if(!empty($product['ml_img'])) $new.="<img data-original='".$product['ml_img']."' class='hide' />";
    $new.="<span class='mark mark-new js-mark'><em>".L('_new_1')."</em></span>";
          echo $new;
    }else{
          $list=$product['goods_img'] ? $product['goods_img'] : $product['list_img'];
          $str="<img data-original='".$list."' alt='".$product['name']."' />";
    if(!empty($product['ml_img'])) $str.="<img data-original='".$product['ml_img']."' class='hide' />";
          echo $str;
    }
    ?>
  </a>
  <a href="<?php echo $product['url'];?>" <?php if($target_blank):?>target="_blank"<?php endif;?>>
    <strong><?php echo $product['name'];?></strong>
    <!--三件套特殊处理 同时要显示两件套价格-->
    <p>
      <!--三件套原价-->
      <?php 
        if($original_price > 0){
        $three_price = currency($product['original_price']);
        $three_result="<del>$three_price</del>";
          echo $three_result;
        }	
         if($product['attribute_type']==2){
            if($product['product_type']){
                echo currency($product['sell_price']);
            }else{
                echo currency($product['advanced_price']);
            }
        }elseif($product['attribute_type']==1){
            echo currency($product['custom_price']);
        }
      ?>
    </p>
  </a>
</li>
<?php
  }
?>
</ul>
<?php endforeach;?>
<?php if($link == 'spring-sale'&& (time() > strtotime('2015-02-02 12:00:00'))):?>
<div class="popup-box align-center email-popup js-email-popup">
  <strong><?php echo L('collection_spring_1');?></strong>
  <i class="line"></i>
  <p style="margin:1em 0;font-size:1.125em;"><?php echo L('collection_spring_2');?></p>
  <form action="<?php echo url('measure/add_email_subscriptions');?>" method="post" class="js-email-subscription">
    <input type="text" name="email" placeholder="<?php echo L('_Your_email_');?>" />
    <input type="hidden" name="type" value="index" />
    <button type="submit" class="btn"><?php echo L('collection_spring_3');?></button>
  </form>
  <a href="<?php echo url('product/all');?>" style="font-size:12px;"><?php echo L('collection_spring_4');?></a>
  </div>
<?php endif;?>
<?php if($link == 'staywithus' && (time() > strtotime('2015-02-02 12:00:00'))):?>
<div class="popup-box align-center email-popup js-email-popup">
  <strong><?php echo L('collection_staywithus_1');?></strong>
  <i class="line"></i>
  <p class="align-left"><?php echo L('collection_staywithus_2');?></p>
  <p class="align-left" style="margin:.8em 0;"><?php echo L('collection_staywithus_3');?></p>
  <a href="<?php echo url('product/all');?>"><?php echo L('collection_staywithus_4');?></a>
</div>
<?php endif;?>
<div class="back-top js-back-top"></div>
<?php include THEMES_PATH.'public/footer2.phtml';?>
<script src="/statics/front/js/plugins/jquery.lazyload.js"></script>
<script>
$(function() {//邮件订阅弹出框
  var $emailPopup = $('.js-email-popup');
  $emailPopup.addClass('show');
  position.fixPosition($emailPopup);
  if ($emailPopup.next('.js-email-mask').length === 0) {
    $emailPopup.after('<div class="mask show js-email-mask"></div>');
  }
});
</script>
<?php include THEMES_PATH.'public/after_body.phtml';?>